function [ pbe, edges ] = ManchesterPeriod( signal, t )
%MANCHESTERPERIOD Returns the periods between falling edges
%   signal - A manchester encoded signal
%   t - The sample timing of the signal

% constants
f=848e3; % carrier frequency

% find falling edges
ix = find(diff(signal)<0);
edges = t(ix);
pbe = round(diff((edges - edges(1)) * f) * 10)/10; % periods between edges

end